package com.doit.day02


object _07_继承 {
  def main(args: Array[String]): Unit = {
    val zi: Zi = new Zi(2,"zss","male")
    zi.playCards()

  }
}

//1.java  定义一个类 ==》 创建对象
//想要重写他，只有val修饰的需要重写，var修饰的可以不重写
class Fu(val id:Int,val name:String,var gender:String){
  def playCards()={
    println("我各种棋牌，样样精通！！")
  }
}

class Zi(override val id:Int =10,override val name:String, gender:String ="female") extends Fu(id,name,gender){
  //子类自己的成员变量
  def playGames(): Unit ={
    println("我什么游戏都精通！！！")
  }
}

// 第一个不管是继承还是实现都是extends  with
class Sun(val address:String,val phone:String,override val name:String) extends Zi(name = name)

